feat: add TypeScript SDK demo app scaffold and Math Standards Alignment evaluator - #132
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a minimal TypeScript demo app under demos/typescript/ that exercises the published @learning-commons/evaluators SDK end-to-end for the Math Standards Alignment evaluator, using a Vite/React frontend and an Express backend to keep API keys server-side.
Changes:
- Introduces a Vite + React UI for selecting grade/jurisdiction/standards, entering a word problem, and viewing raw evaluator JSON output.
- Adds an Express API server with endpoints for jurisdictions, standards lookup (via Knowledge Graph REST), and evaluation via
MathStandardsAlignmentEvaluator. - Includes spec/plan/tasks docs and a README for setup and local running.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| demos/typescript/vite.config.ts | Adds Vite dev-server proxy for /api to the Express backend. |
| demos/typescript/tsconfig.json | Adds demo-local TypeScript config for client + server code. |
| demos/typescript/tasks.md | Tracks implementation tasks and verification notes for the demo. |
| demos/typescript/src/main.tsx | React entrypoint mounting the demo app. |
| demos/typescript/src/App.tsx | Main UI and client-side API calls for the demo flow. |
| demos/typescript/src/App.css | Minimal styling for the demo UI. |
| demos/typescript/spec.md | Defines the demo requirements and API behavior. |
| demos/typescript/server/kg.ts | Implements Knowledge Graph REST helpers for listing standards. |
| demos/typescript/server/index.ts | Implements Express endpoints and evaluator invocation. |
| demos/typescript/README.md | Documents setup, required keys, and how to run locally. |
| demos/typescript/plan.md | Documents demo structure and key design decisions. |
| demos/typescript/package.json | Adds demo package manifest and scripts (dev/typecheck). |
| demos/typescript/package-lock.json | Locks demo dependencies for reproducible installs. |
| demos/typescript/index.html | Vite HTML shell for the React app. |
| demos/typescript/.gitignore | Ignores build output, deps, and .env for the demo. |
| demos/typescript/.env.example | Documents required environment variables for the backend. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
304e3de to
cdbd4c6
Compare
czi-fsisenda
left a comment
There was a problem hiding this comment.
Looks good!
Should the plan, spec, tasks files be checked in?
| @@ -0,0 +1,5 @@ | |||
| # Anthropic API key | |||
| ANTHROPIC_API_KEY=sk-ant-... | |||
There was a problem hiding this comment.
nit: should have quotes
|
…risdiction select
cdbd4c6 to
2f04697
Compare
What
A minimal web app under
demos/typescript/demonstrating the published@learning-commons/evaluatorsSDK, structured as two features so more evaluators can be added later:Design
react-router-domfrontend; small Express backend. The SDK is Node-only (top-levelnode:*imports on the eval path), so all SDK calls run server-side and the browser never sees API keys (Vite proxies/apito the backend).src/evaluators.tsx) that both the home page and the router consume; the backend exposesGET /api/healthand a single call site where each feature registers its routes. Adding an evaluator = a new page + one registry entry + a new003-…spec, touching nothing else.GET /api/jurisdictions(from the SDK'sJurisdictionenum),GET /api/standards(Knowledge Graph lookup),POST /api/evaluate(MathStandardsAlignmentEvaluator.evaluateItems). If the required keys are absent the routes still mount but return 503, so the scaffold and other evaluators keep working.SIGINT/SIGTERMshutdown (server.close+closeAllConnections) so dev-server restarts don't hang or orphan the process.specs/001-demo-app-scaffold/andspecs/002-math-standards-alignment/, each withspec.md/plan.md/tasks.md.SDK gaps surfaced (follow-ups, out of scope here)
KnowledgeGraphClientisn't exported, soserver/kg.tscalls the KG REST API directly to populate the picker. A future release should export agetStandardsByGrade-style helper.ai >=6.0.0but is built againstai@7(@ai-sdk/providerspec v4); installingai@6with@ai-sdk/anthropic@4throws a runtime "Unsupported model version" error. The demo pinsai@^7; the SDK peer should be tightened toai >=7.Verification
tsc --noEmitclean;vite buildclean./api/healthand route wiring smoke-tested.